RGCMDS “Row Graphics compression Commands”. SIZE: 207 bytes. ID #92 01 CPRSRG$($) 02 EXPDRG$($) --------------------------------------------- These functions are for compressing (packing) and expanding (unpacking) graphic strings for more efficient storage. Originally used with the ThinkJet Space Shuttle demo by HP. CPRSRG$(A$), read "ComPReSs Row-Graphic String" searches A$ for null bytes [CHR$(0)] and replaces them all with a single null fol- lowed by a count byte. This usually gives a shorter string than the original one, but can result in a longer one if the original contains many single nulls. The greatest efficiency is obtained with strings containing many nulls in a row (graphic white space). EXPDRG$(A$), read "EXPanD Row-Graphic String" expands a compressed string back to its original contents by looking for any null and replacing it with as many nulls as the next byte indicates. Non-graphic data seldom contains nulls, so packing them with RGCMDS is inefficient. A lexfile designed for packing ASCII text is called SPACKLX (464 bytes) and uses an algorithm optimized for strings composed of a narrow range of byte values, which most non- graphics data contain.